using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GoldDigger.Models;
using GoldDigger.Sprites;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
using TPL.Xna.Common;

namespace GoldDigger.Screens
{
    internal class TestScreen : Screen
    {
        private ShapeSprite _square;
        public override void LoadContent()
        {
            //_square = ShapeSprite.CreateSquare(ScreenManager.GraphicsDevice, new Vector2(0, 0), new Vector2(200, 200));
            //_square.Position = new Vector2(100,100);
            //AddSprite(_square);

                  Rectangle frameSize = new Rectangle(0, 0, 42, 46);
            Point sheetSize = new Point(3, 2);

            var coinImage = ScreenManager.Game.Content.Load<Texture2D>(@"Images/coin-sheet");
            var spriteSheetInfo = new SpriteSheetItemInfo
            {
                FrameSize = frameSize,
                SheetSize = sheetSize,
                Image = coinImage,
            };
            AddSprite(new SpriteSheetItemSprite(spriteSheetInfo)
                          {
                              Position = new Vector2(100,100)
                          });

            //SceneModel model =
            //    new SceneModel
            //        {
            //            Level = 1,
            //            PlayTime = 60,
            //            TargetValue = 500,
            //            ItemSprites = new[]
            //                              {
            //                                  new ItemModel
            //                                      {
            //                                          Type = ItemSpriteType.SmallGold,
            //                                          X = 100f,
            //                                          Y = 200f,
            //                                      },
            //                                  new ItemModel
            //                                      {
            //                                          Type = ItemSpriteType.MediumGold,
            //                                          X = 200f,
            //                                          Y = 200f,
            //                                      },                                          
            //                                  new ItemModel
            //                                      {
            //                                          Type = ItemSpriteType.BigGold,
            //                                          X = 300f,
            //                                          Y = 200f,
            //                                      },                                          
            //                                  new ItemModel
            //                                      {
            //                                          Type = ItemSpriteType.SmallRock,
            //                                          X = 400f,
            //                                          Y = 200f,
            //                                      },                                          
            //                              }
            //        };
            //SceneLoader.Save(model);]

            //ScreenManager.Game.Content.LoadScene(1);

            base.LoadContent();
        }

        private float _count;
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            //_count += 0.1f;
            ////_square.ClearVectors();
            ////_square.CreateSquare(new Vector2(100 + _count, 100+_count), new Vector2(200 + _count, 200+_count));

            //_square.Position += new Vector2(_count, 0);
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

        }

        public override void Draw(GameTime gameTime)
        {

            base.Draw(gameTime);
        }
    }
}
